﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Common.Infrastructure
{
    [AttributeUsage(AttributeTargets.Property, Inherited = true)]
    public class ModelFieldEnumNameAttribute : Attribute
    {
        private readonly string enumName = null;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="_idFieldName">ID字段名称</param> 
        public ModelFieldEnumNameAttribute(string enumName)
        {
            if (string.IsNullOrEmpty(enumName))
            {
                throw new Exception("idFieldName is null");
            }

            this.enumName = enumName;
        }

        /// <summary>
        /// ID字段名称
        /// </summary>  
        public string EnumName
        {
            get { return enumName; }
        }
    }
}
